package com.lc.learn.fileana.common.constant;

import java.util.Arrays;
import java.util.List;

/**
 * @description: 文件解析所需常量
 * @author: LChuang
 * @date: 2023/10/31 13:40
 */
public class AnalyseConstant {

    /**
     * doc的内容格式前缀
     * 标题 styleName：标题 1，标题 2，...
     * 正文 styleName："正文"
     */
    public static final String DOC_TITLE_PREFIX = "标题 ";
    public static final String DOC_TEXT_PREFIX = "正文";
    /**
     * docx的内容格式前缀
     * 标题 styleName：heading 1，heading 2，...
     * 正文 styleName：null
     */
    public static final String DOCX_TITLE_PREFIX = "heading ";

    /**
     * itextpdf读取pdf标题的map键值
     */
    public static final String PDF_ACTION_DEFAULT = "Action";
    public static final String PDF_TITLE_DEFAULT = "Title";
    public static final String PDF_PAGE_DEFAULT = "Page";
    public static final String PDF_KIDS_DEFAULT = "Kids";

    /**
     * md
     */
    public static final String MD_TITLE_PREFIX = "#";
    public static final String MD_TITLE_DEFAULT = "h1";
    public static final Integer MD_TITLE_LEVEL = 1;


    // 用于替换的前缀
    public static final String REPLACE_TITLE_PREFIX = "h";
    public static final String REPLACE_TEXT_PREFIX = "p";
    // 替换后的所有标题等级
    public static final List<String> WORD_TITLE_LIST = Arrays.asList("h1", "h2", "h3", "h4");
    // 默认标题等级：正文
    public static final Integer DEFAULT_LEVEL = -1;
    // 字符串中特殊字符替换
    public static final String REGEXP = "[\n\t\r`~!@#$%^&*()+=|{}':;',\\[\\].<>/?~！@#￥%……&*（）——+|{}【】‘；：”“’。， 、？]";
    public static final String REPLACE = "";
    // 不进行解析的文件类型
    public static final List<String> NOT_ANALYSE_SUFFIX = Arrays.asList(".ppt", ".pptx", ".zip", ".rar", ".7z", ".jpg", ".png", ".mp3", ".mp4");
}
